/**
 * 
 */
package com.sci.web.action.datareportseason;

import javax.annotation.Resource;

import com.sci.web.action.util.BaseAction;
import com.sci.web.bean.Enterprise_Project;
import com.sci.web.dao.DataReportM_ProjectDao;

/**
 * @author  BaiFuyou
 * @date: Nov 5, 2011 2:01:30 PM
 * 
 * 插入一条项目数据
 */
public class AddNewEnterpriseProject_BaseInfoAction extends BaseAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1310960810219321577L;
	@Resource
	private DataReportM_ProjectDao dataReportM_ProjectDao;
	private int uid;
	private String year;
	private String project_name;
	private String project_start_time;
	private String project_end_time;
	private String project_government_money;
	private int type;
	private int project_type;
	private int project_is_major;
	/**
	 * @return the uid
	 */
	public int getUid() {
		return uid;
	}
	/**
	 * @param uid the uid to set
	 */
	public void setUid(int uid) {
		this.uid = uid;
	}
	/**
	 * @return the year
	 */
	public String getYear() {
		return year;
	}
	/**
	 * @param year the year to set
	 */
	public void setYear(String year) {
		this.year = year;
	}
	/**
	 * @return the project_name
	 */
	public String getProject_name() {
		return project_name;
	}
	/**
	 * @param project_name the project_name to set
	 */
	public void setProject_name(String project_name) {
		this.project_name = project_name;
	}
	/**
	 * @return the project_start_time
	 */
	public String getProject_start_time() {
		return project_start_time;
	}
	/**
	 * @param project_start_time the project_start_time to set
	 */
	public void setProject_start_time(String project_start_time) {
		this.project_start_time = project_start_time;
	}
	/**
	 * @return the project_end_time
	 */
	public String getProject_end_time() {
		return project_end_time;
	}
	/**
	 * @param project_end_time the project_end_time to set
	 */
	public void setProject_end_time(String project_end_time) {
		this.project_end_time = project_end_time;
	}
	/**
	 * @return the project_government_money
	 */
	public String getProject_government_money() {
		return project_government_money;
	}
	/**
	 * @param project_government_money the project_government_money to set
	 */
	public void setProject_government_money(String project_government_money) {
		this.project_government_money = project_government_money;
	}
	/**
	 * @return the type
	 */
	public int getType() {
		return type;
	}
	/**
	 * @param type the type to set
	 */
	public void setType(int type) {
		this.type = type;
	}
	/**
	 * @return the project_type
	 */
	public int getProject_type() {
		return project_type;
	}
	/**
	 * @param project_type the project_type to set
	 */
	public void setProject_type(int project_type) {
		this.project_type = project_type;
	}
	/**
	 * @return the project_is_major
	 */
	public int getProject_is_major() {
		return project_is_major;
	}
	/**
	 * @param project_is_major the project_is_major to set
	 */
	public void setProject_is_major(int project_is_major) {
		this.project_is_major = project_is_major;
	}
	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		super.setContentType(super.JSON);
		Enterprise_Project ep = new Enterprise_Project();
		ep.setEditable(1);
		ep.setEnterprise_id(dataReportM_ProjectDao.getEnterpriseBaseIdByUid(uid));
		ep.setProject_check_pass(3);
		ep.setProject_end_time(project_end_time.trim().substring(0, 10));
		ep.setProject_government_money(project_government_money.trim());
		ep.setProject_id(0);
		ep.setProject_is_major(project_is_major);
		ep.setProject_is_new(0);
		ep.setProject_name(project_name.trim());
		ep.setProject_start_time(project_start_time.trim().substring(0,10));
		ep.setProject_type(project_type);
		ep.setProject_type_sb(type);
		ep.setProject_year(year);
		if(dataReportM_ProjectDao.insertNewEnterpriseProject(ep)){
			super.outPrint("ok");
		}else{
			super.outPrint("fail");
		}
		return "json";
	}
	

}
